var test1="只能对汉字加3密6?"

test10=encodeURIComponent(test1)
console.log(encodeURIComponent(test1),'??????????????')
test01 = decodeURIComponent(test1)
console.log(test01)
let a = 'WAWA'
console.log(encodeURIComponent(a))

//以上只能对汉字加密
function compile(code)  
{    
   var c=String.fromCharCode(code.charCodeAt(0)+code.length);  
   for(var i=1;i<code.length;i++){  
   c+=String.fromCharCode(code.charCodeAt(i)+code.charCodeAt(i-1));  
   }  
   return encodeURIComponent(c);  
}  
 
function uncompile(code)  
{  
   code=unescape(code);  
   var c=String.fromCharCode(code.charCodeAt(0)-code.length);  //获取它的ascii码:
   for(var i=1;i<code.length;i++){  
   c+=String.fromCharCode(code.charCodeAt(i)-c.charCodeAt(i-1));  
   }  
   return c;  
} 
console.log(compile('waaw'),'对字母的加密``')